 <SCRIPT LANGUAGE="JavaScript">
<!-- Begin
function checkAll(field)
{
	
	if(field[0].checked == false)
	{
		for (j = 0; j < field.length; j++)
		field[j].checked = true ;
	}
	else
	{
		for (j = 0; j < field.length; j++)
		field[j].checked = false ;
	}
}

//  End -->
</script>
<div style="text-align:left;">
<form method="post" name="feedSettings" action="feedsSettings_process.php">
<table border="0" width="85%" cellpadding="10px" cellspacing="10px">
	<tr><td colspan="6"><span class="arial-12pt darkGray">Enter settings</span></td></tr>    
    <tr>
    <td>Things I share</td>
    <?php $sql=mysql_query("select * from share_things_master"); 
	while($row=mysql_fetch_array($sql))
	{
		echo "<td align='center'>".$row['share_things']."</td>";
	}
	?>
    </tr>
    <?php $query=mysql_query("select * from things_shared_master where set_id=2"); 
	$j="1";
	while($result=mysql_fetch_array($query))
	{
	?>
    <tr>
    	<td><?php echo $result['things_shared']; ?></td>

        <td align="center"><input type="checkbox" name="every[]" id="every" value="<?php echo $result['things_shared_id']; ?>" onClick="checkAll(document.feedSettings.<?php echo 'myfrds'.$j;?>)"/></td> 

        <td align="center"><input type="checkbox" name="myfrds[]" id="<?php echo "myfrds".$j; ?>" value="<?php echo $result['things_shared_id']; ?>" /></td>

        <td align="center"><input type="checkbox" name="frds_of_frds[]" id="<?php echo "myfrds".$j; ?>" value="<?php echo $result['things_shared_id']; ?>" /></td>

        <td align="center"><input type="checkbox" name="celebrity[]" id="<?php echo "myfrds".$j; ?>" value="<?php echo $result['things_shared_id']; ?>" /></td>

        <td align="center"><input type="checkbox" name="fans[]" id="<?php echo "myfrds".$j; ?>" value="<?php echo $result['things_shared_id']; ?>" /></td>

	</tr>	
	<?php
	$j++;
    }
	?>

    
</table>
<input type="submit" name="submit" value="Submit" />
</form>
</div>